package edu.whu.demo.config;

import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 @author psh
  * @create 2023/10/24 - 24:00
 */
@Configuration
public class MpConfig {
    @Bean
    public MybatisPlusInterceptor mpInterceptor(){
        //1.定义Mp拦截器

        MybatisPlusInterceptor mInterceptor = new MybatisPlusInterceptor();

        mInterceptor.addInnerInterceptor(new PaginationInnerInterceptor());

        return mInterceptor;
    }
}
